
 gl code 		[if want directory for code files]	


****************************************************************************
*This section will produce all SWEDEN results for the main text and appendix

* Prepare the raw data for analysis
do ${code}/prep.do

* Generate an income panel with incomes > 100USD ("IGE" sample)
do ${code}/swepanel_100usd.do

* Generate an income panel including zeros (main sample)
do ${code}/swepanel_zeros.do

* Trends analyses (dta file and actual SWE Figures 1-4)
do ${code}/fig1-4_swe.do 

* Descriptive statistics (SWE dta file for Table 1)
do ${code}/descr_byperiod_swe.do 

* Assortative mating (Figure 5) and conditional trends (Figure A1)
do ${code}/fig5_figA1_swe.do 

* Main decomposition (SWE dta files for Figures 6-7)
gl yrmin=1985
gl yrmax=1995
do ${code}/SE_model_5b_sequential_parent_AM.do  	// maternal IRP
do ${code}/SE_model_5bF_sequential_parent_AM.do		// paternal IRP
do ${code}/SE_model_5bavg_sequential_parent_AM.do	// household income IRP
gl yrmin=2008
gl yrmax=2019
do ${code}/SE_model_5b_sequential_parent_AM.do
do ${code}/SE_model_5bF_sequential_parent_AM.do
do ${code}/SE_model_5bavg_sequential_parent_AM.do

* Main decomposition model for employment transmission to daughters (SWE dta files for Figure 8)
gl yrmin=1985
gl yrmax=1995
do ${code}/SE_model_5b_daughters_empu.do
do ${code}/SE_model_5b_daughters_empxb.do
gl yrmin=2008
gl yrmax=2019
do ${code}/SE_model_5b_daughters_empu.do
do ${code}/SE_model_5b_daughters_empxb.do

* Causal vs measurement error (SWE dta files for Table 2)
do ${code}/irps_causal_vs_me.do
do ${code}/irps_causal_vs_me_incomesIV.do
do ${code}/irps_causal_vs_me_eduempIV.do



*** APPENDIX

* Appendix A (Figures A2, A5, A6, A7, A9)
do ${code}/figsappendix_swe.do

* Appendix B decomposition (SWE dta files for simple model)
gl yrmin=1985
gl yrmax=1995
do ${code}/SE_model_2b_sequential_parent-only.do
do ${code}/SE_model_2bF_sequential_parent-only.do
gl yrmin=2008
gl yrmax=2019
do ${code}/SE_model_2b_sequential_parent-only.do
do ${code}/SE_model_2bF_sequential_parent-only.do


